#%RAML 1.0
title: Party API
baseUri: http://localhost:8081
version: v1

documentation:
  - title: mod-users API
    content: This documents the API calls that can be made to query and manage users of the system

types:
  rule: !include participationRules.json
  ruleCollection: !include participationRulesCollection.json
  errors: !include raml-util/schemas/errors.schema

traits:
  orderable: !include raml-util/traits/orderable.raml
  pageable: !include raml-util/traits/pageable.raml
  searchable: !include raml-util/traits/searchable.raml
  language: !include raml-util/traits/language.raml
  validate: !include raml-util/traits/validation.raml
  facets: !include raml-util/traits/facets.raml

resourceTypes:
  collection: !include raml-util/rtypes/collection.raml
  collection-item: !include raml-util/rtypes/item-collection.raml
  get-only: !include raml-util/rtypes/get-only.raml
  post-empty-body: !include raml-util/rtypes/post-empty-body.raml
  collection-get: !include raml-util/rtypes/collection-get.raml
  item-collection-put: !include raml-util/rtypes/item-collection-put.raml


/party/rules:
  type:
    collection:
      exampleCollection: !include examples/participationRulesCollection.sample
      exampleItem: !include examples/participationRules.sample
      schemaCollection: ruleCollection
      schemaItem: rule
  get:
    is: [
      searchable: {description: "", example: "active=true sortBy username"},
      pageable,
      validate
    ]
  post:
    is: [validate]

  /modify/{id}:
      displayName: rule
      description: 获取，删除或更新黑名单规则
      type:
        collection-item:
           schema: rule
           exampleItem: !include examples/participationRules.sample

  /switch/{id}:
        displayName: rule
        description: 开启黑名单规则
        type:
           item-collection-put:
             schema: rule
             exampleItem: !include examples/participationRules.sample